package com.gitee.target123.develop.login.properties;

import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthDefaultSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.util.HashMap;
import java.util.Map;

@ConfigurationProperties(prefix = "justauth")
public class JustAuthProperties {

    /**
     * 是否启用 JustAuth
     */
    private boolean enabled = false;

    /**
     * JustAuth 默认配置
     */
    private Map<AuthDefaultSource, AuthConfig> type = new HashMap<>();

    /**
     * JustAuth 自定义配置
     */
    @NestedConfigurationProperty
    private ExtendProperties extend;

    /**
     * 缓存配置类
     */
    @NestedConfigurationProperty
    private CacheProperties cache = new CacheProperties();

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Map<AuthDefaultSource, AuthConfig> getType() {
        return type;
    }

    public void setType(Map<AuthDefaultSource, AuthConfig> type) {
        this.type = type;
    }

    public ExtendProperties getExtend() {
        return extend;
    }

    public void setExtend(ExtendProperties extend) {
        this.extend = extend;
    }

    public CacheProperties getCache() {
        return cache;
    }

    public void setCache(CacheProperties cache) {
        this.cache = cache;
    }
}
